/**
 * 系统布局
 * */
export default {
  namespaced: true,
  state: {
      // 正在修改的组件元素
      editingElement: {}

  },
  mutations: {
      /**
       * 设置修改中的元素
       */
      setEditingElement (state, payload) {
          console.log('我执行了')
          state.editingElement = payload
      },
       /**
       * 设置修改中元素的样式
       */
      setElementCommonStyle (state, payload) {
        state.editingElement.commonStyle = {
          ...state.editingElement.commonStyle,
          ...payload
        }
      },
      recordRect (state, { type, value }) {

      }
    },
    actions: {
      setElementPosition ({ commit }, payload) {
        commit('setElementCommonStyle', payload)
      },
      setElementShape ({ commit }, payload) {
        commit('setElementCommonStyle', payload)
      },
      recordElementRect ({ commit }, payload = {}) {
        commit('recordRect', payload)
      },
    }
  }